home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10674 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: omega.ntu.ac.sg!sg7248613
  2. From: sg7248613@omega.ntu.ac.sg
  3. Newsgroups: comp.lang.c
  4. Subject: fscanf problem
  5. Date: 19 Mar 96 18:40:44 +0800
  6. Organization: Nanyang Technological University - Singapore
  7. Message-ID: <1996Mar19.184044@omega.ntu.ac.sg>
  8. NNTP-Posting-Host: omega.ntu.ac.sg
  9.  
  10. I have been trying to read a section of data from a file for days.
  11.  
  12. The data segment goes like this:
  13.     .....
  14.     Patch norm0 4 { { 0 -1 0 } { 0 -1 0 } { 0 -1 0 } { 0 -1 0 } }
  15.     Patch vert0 4 { { 0 1 0 } { 1 1 0 } { 1 1 1 } { 0 1 1 } }.
  16.     .....
  17. My actual code segment is as follows:
  18.  
  19. fscanf(meshf, "    Patch %s %d { { %f %f %f } { %f %f %f } { %f %f %f }\
  20.             { %f %f %f } }\n    Patch %s %d { { %f %f %f } { %f %f %f }\
  21.             { %f %f %f } { %f %f %f } }\n", pptr->nname, &(pptr->numVert),
  22.             &tmpf[0], &tmpf[1], &tmpf[2], &tmpf[3], &tmpf[4], &tmpf[5],
  23.             &tmpf[6], &tmpf[7], &tmpf[8], &tmpf[9], &tmpf[10], &tmpf[11],
  24.             pptr->vname, &tmpi,
  25.             &tmpg[0], &tmpg[1], &tmpg[2], &tmpg[3], &tmpg[4], &tmpg[5],
  26.             &tmpg[6], &tmpg[7], &tmpg[8], &tmpg[9], &tmpg[10], &tmpg[11]);
  27.  
  28. The read of the first line is OK. But I can't scanf the second line
  29. successfully. Could anyone please enlighten me on this? Thank you!
  30.